package com.demo.web;

import com.demo.bean.Gender;
import com.demo.bean.Result;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class GenderController
{
    @GetMapping("/genders")
    public Result findGenders()
    {
        List<Gender> list = new ArrayList<>();
        Gender gender1 = new Gender("m", "男");
        Gender gender2 = new Gender("f", "女");
        list.add(gender1);
        list.add(gender2);
        return new Result(list.size(), list);
    }
}
